package com.bluegalaxy.nhb.snservice.core.util;

/**
 * Created by IntelliJ IDEA.
 * User: ZhangMJ
 * Date: 15-5-20
 * Time: 上午8:58
 * To change this template use File | Settings | File Templates.
 */
public class NumberUtil {
    private final static int FILE_BUFFER_SIZE = 20480;


    public static void main(String[] args) {
        int count = 57;
        int length = String.valueOf(count).length();
        System.out.println(count/5);
        System.out.println(count%5);
//        System.out.println(String.format("%03X", count));
        System.out.println(NumberUtil.dealNumber(3));


    }
    //获取位数整倍数
    public static int dealNumber(int count) {
        if (count < 10){
            return 10;
        }
        int length = String.valueOf(count).length();
        String w = "1";
        String v = "";
        for (int n = 0;n<length-1;n++){
            v += "0";
        }
        int len = Integer.parseInt(w+v);
        System.out.println("l==="+len);

        if (count > len && (count % len != 0)) {
            count = count / len * len + len;
        }

        return count;
    }


}
